package com.example.twoscroolview.activity

import android.os.Bundle
import android.view.MotionEvent
import androidx.appcompat.app.AppCompatActivity
import com.example.twoscroolview.R

class TouchEventDemoActivity : AppCompatActivity() {
    val TAG=    "TouchEventDemoActivity"
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
    }

    override fun dispatchTouchEvent(ev: MotionEvent?): Boolean {
        if(ev?.action ==MotionEvent.ACTION_DOWN){
            println("TouchEventDemoActivity---dispatchTouchEvent2")
        }
        return super.dispatchTouchEvent(ev)
    }

    override fun onTouchEvent(event: MotionEvent?): Boolean {
        if(event?.action ==MotionEvent.ACTION_DOWN){
            println("TouchEventDemoActivity---onTouchEvent")
        }
        return super.onTouchEvent(event)
    }
}